| ~ (Bitwise NOT) The Bitwise NOT operator is used to perform the Boolean NOT operation on the number given before the tilde (~). The number is converted to its 32 bit binary equivelant. All ones in the binary number are then switched to zeros, and all zeros are switched to ones. The new number is then converted to a whole decimal number (an integer). This new number is then returned as the product of the operation. The Biwise NOT operation is also referred to as an inversion. Both negative and positive numbers may be evaluated using the NOT operator. syntax: ~ number EXAMPLE variableOne = ~ 1500; document.write("The result of the NOT operation on 1500 is " + variableOne); The example shows that variableOne has been loaded with the NOT operator, which wil NOT the decimal integer 1500. The document.write statement then writes the contents of variableOne to the screen, which is -1501. |